/*
 * Copyright (C) 2015 Actor LLC. <https://actor.im>
 */

.toolbar {
  font-size: 14px;

  position: relative;
  z-index: 10;

  box-sizing: border-box;
  height: $toolbar-height;
  margin: 0;
  padding: 0 16px;

  color: $toolbar-text-color;
  box-shadow: inset 0 -1px 0 0 rgba(0, 0, 0, .04);

  flex: 0 0 auto;;

  &__calling {
    color: $call-title-color;
    background-color: $call-background;
    box-shadow: none;

    .toolbar__peer__message {
      color: $call-title-color;
    }
    .button--icon {
      i {
        color: $call-title-color;
      }

      &.active {
        i {
          color: $dark-sky-blue;
        }
      }
    }
  }

  &__peer {
    overflow: hidden;

    width: 0; // Strange fix for firefox

    header {
      width: 100%;
      height: 20px;
      margin-top: 12px;
    }

    &__title {
      font-size: 16px;
      font-weight: 500;
      line-height: 20px;

      display: inline-block;

      @include text-elipsis();
      .emoji-outer {
        width: 20px;
        height: 20px;

        vertical-align: top;
      }
    }
    &__favorite {
      display: inline-block;

      margin-left: 4px;

      vertical-align: top;

      .material-icons {
        font-size: 18px;
        line-height: 20px;

        cursor: pointer;

        color: rgba(black, .3);
        &:hover {
          color: $squash;
        }
      }
      &--active {
        .material-icons {
          color: $squash;
        }
      }
    }

    &__verified {
      display: inline-block;

      margin-left: 6px;

      cursor: default;
      vertical-align: top;

      .material-icons {
        font-size: 16px;
        line-height: 20px;

        color: $color-green;
      }
    }
    &__message {
      font-size: 14px;
      line-height: 16px;

      display: block;

      margin-top: 2px;

      color: $toolbar-secodary-text-color;

      @include text-elipsis();
    }
  }

  &__controls {
    box-sizing: border-box;
    margin-top: 14px;
    &__buttons {
      .button--icon {
        color: rgba(0, 0, 0, .25);
        &.active {
          color: $dark-sky-blue;
        }
      }
    }
  }
}

.toolbar__avatar {
  margin-top: 10px;
  margin-right: 16px;
}

// Connection state banner
.connection-state {
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;

  position: absolute;
  z-index: 1000;
  top: 8px;
  right: 16px;
  left: 16px;

  padding: 4px 10px;

  cursor: default;
  transition: opacity 500ms 0ms, visibility 0ms 0ms;
  text-align: center;

  color: white;
  border-radius: 3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .1);

  &--online {
    visibility: hidden;

    transition: opacity 500ms 1500ms, visibility 0ms 2s;

    opacity: 0;
    background-color: rgba($apple, .97);
  }
  &--connection {
    background-color: rgba($squash, .97);
  }
}

.toolbar__search {
  position: relative;

  width: 200px;
  margin-right: 8px;

  transition: width 200ms ease-out;
  .search-icon {
    font-size: 22px;
    line-height: 24px;

    position: absolute;
    top: 6px;
    left: 10px;

    pointer-events: none;

    color: rgba(black, .25);
  }
  .close-icon {
    font-size: 20px;

    position: absolute;
    top: 8px;
    right: 8px;

    cursor: pointer;

    color: rgba(black, .25);
    &:hover {
      color: rgba(black, .5);
    }
  }

  .input:focus,
  &--focused .input {
    color: rgba(black, .6);
    background-color: white;
    box-shadow: 0 0 0 2px $dark-sky-blue;
    & + .search-icon {
      color: $dark-sky-blue;
    }
  }

  .input {
    padding-left: 38px;
  }

  &--focused {
    width: 340px;
  }
}
